<?php
defined('BASEPATH') OR exit('No direct script access allowed');


use QCloud_WeApp_SDK\Mysql\Mysql as DB;



class ProductInfoHtml extends CI_Controller {
    public function index() {
        $pid = $_GET['pid'];
        $short = $_GET['short'];

        if($pid){
            $rows = DB::row('cc_goods_introduction',['*'], ['pid' => $pid]);
//            if($rows){
//                DB::update('cc_goods_introduction',['short' => $short], ['pid' => $pid]);
//            }else{
//                $rows = DB::insert('cc_goods_introduction',['short' => $short,'pid' => pid]);
//                if($rows){
//                    $rows = DB::row('cc_goods_introduction',['*'], ['pid' => $pid]);
//                }
//            }
        }

        if (!empty($rows)){
            $this->json([
                'code' => 0,
                'data' => $rows
            ]);
        } else {
            $this->json([
                'code' => -1,
                'error' => $rows['error']
            ]);
        }
    }
}
